package singleton.demo3;

public class YaFactory {

    private static YaFactory yaFactory ;

    private YaFactory(){
    }

    public static YaFactory getInstance(){
        if (yaFactory == null){
            yaFactory = Helper.FACTORY;
        }
        return yaFactory;
    }

    // 静态内部类
    static class Helper{
        final static YaFactory FACTORY = new YaFactory();



    }
}
